﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Data;
using DongleManage.Model.BaseClass;

namespace  DongleManage.Model.Member
{

		
	/// <summary>
	///  表'MemberInfo'的实体表示.
	/// </summary>
	/// <remarks>
	/// 该实体由工具生成，尽量不要手动修改
	/// </remarks>
	[DataContract]
	public partial class MemberInfoEntity :BaseEntity
	{
		#region 属性、变量声明
		#region 主属性 --对应数据表主键
		/// <summary>			
		/// CustomerID : 
		/// </summary>
		/// <remarks>表MemberInfo主键</remarks>
		[DisplayName("会员ID")]
		[DataMember]
		public Int32 CustomerID
        {
            get;
            set;
        }
		#endregion
		
		#region 属性
		
		/// <summary>
		/// LoginName : 登录名
		/// </summary>
        [DisplayName("登录名")]
        [Required(ErrorMessage = "不允许为空!")]
        [StringLength(128, ErrorMessage = "请勿输入超过 128 个字!")]
        
		[DataMember]
		public String LoginName
        {
            get;
            set;
        }
		
		/// <summary>
        /// RealName : 真实姓名
		/// </summary>
        [DisplayName("真实姓名")]
        [StringLength(128, ErrorMessage = "请勿输入超过 128 个字!")]
        
		[DataMember]
		public String RealName
        {
            get;
            set;
        }
		
		/// <summary>
		/// CustomerName : 昵称
		/// </summary>
        [DisplayName("昵称")]
        [Required(ErrorMessage = "不允许为空!")]
        [StringLength(128, ErrorMessage = "请勿输入超过 128 个字!")]
        
		[DataMember]
		public String CustomerName
        {
            get;
            set;
        }
		
		/// <summary>
		/// Gender :性别 0:男 1:女 2:不定
		/// </summary>
        [DisplayName("性别0:男 1:女 2:不定")]
        
		[DataMember]
		public Int32? Gender
        {
            get;
            set;
        }
		
		/// <summary>
		/// Age : 年龄
		/// </summary>
        [DisplayName("年龄")]
        
		[DataMember]
		public Int32? Age
        {
            get;
            set;
        }
		
		/// <summary>
		/// DateOfBirth : 出生日期
		/// </summary>
        [DisplayName("出生日期")]
        [Required(ErrorMessage = "不允许为空!")]
        
		[DataMember]
		public DateTime DateOfBirth
        {
            get;
            set;
        }
		
		/// <summary>
		/// IdentityCard : 身份证
		/// </summary>
        [DisplayName("身份证")]
        [StringLength(64, ErrorMessage = "请勿输入超过 64 个字!")]
        
		[DataMember]
		public String IdentityCard
        {
            get;
            set;
        }
		
		/// <summary>
		/// RegionCode :区域代码 
		/// </summary>
        [DisplayName("区域代码")]
        [StringLength(6, ErrorMessage = "请勿输入超过 6 个字!")]
        
		[DataMember]
		public String RegionCode
        {
            get;
            set;
        }
		
		/// <summary>
        /// Adress : 地址
		/// </summary>
        [DisplayName("地址")]
        [StringLength(128, ErrorMessage = "请勿输入超过 128 个字!")]
        
		[DataMember]
		public String Adress
        {
            get;
            set;
        }
		
		/// <summary>
		/// Organization : 工作单位
		/// </summary>
        [DisplayName("工作单位")]
        [StringLength(256, ErrorMessage = "请勿输入超过 256 个字!")]
        
		[DataMember]
		public String Organization
        {
            get;
            set;
        }
		
		/// <summary>
		/// Identity :会员身份 0:为学员 1为教练 
		/// </summary>
        [DisplayName("会员身份0:为学员 1为教练 ")]
        [Required(ErrorMessage = "0:为学员 1为教练 不允许为空!")]
        
		[DataMember]
		public Int32 Identity
        {
            get;
            set;
        }
		
		/// <summary>
		/// Grade : 级别，学员和教练来的基本不同
		/// </summary>
        [DisplayName("级别")]
        [Required(ErrorMessage = "不允许为空!")]
        
		[DataMember]
		public Int32 Grade
        {
            get;
            set;
        }
		
		/// <summary>
		/// CellPhone :手机 
		/// </summary>
        [DisplayName("手机")]
        [StringLength(24, ErrorMessage = "请勿输入超过 24 个字!")]
        
		[DataMember]
		public String CellPhone
        {
            get;
            set;
        }
		
		/// <summary>
		/// Phone :座机 
		/// </summary>
        [DisplayName("座机")]
        [StringLength(24, ErrorMessage = "请勿输入超过 24 个字!")]
        
		[DataMember]
		public String Phone
        {
            get;
            set;
        }
		
		/// <summary>
		/// QQ : 
		/// </summary>
        [DisplayName("QQ")]
        [StringLength(64, ErrorMessage = "请勿输入超过 64 个字!")]
        
		[DataMember]
		public String QQ
        {
            get;
            set;
        }
		
		/// <summary>
		/// EMail : 
		/// </summary>
        [DisplayName("EMail")]
        [RegularExpression(@"^[\w\-\.]+@[\w\-\.]+(\.\w+)+$", ErrorMessage = "输入格式有误!")]
        [StringLength(64, ErrorMessage = "请勿输入超过 64 个字!")]
        
		[DataMember]
		public String EMail
        {
            get;
            set;
        }
		
		/// <summary>
		/// MSN : 
		/// </summary>
        [DisplayName("MSN")]
        [StringLength(64, ErrorMessage = "请勿输入超过 64 个字!")]
        
		[DataMember]
		public String MSN
        {
            get;
            set;
        }
		
		/// <summary>
		/// Memo :备注 
		/// </summary>
        [DisplayName("备注")]
        [StringLength(512, ErrorMessage = "请勿输入超过 512 个字!")]
        
		[DataMember]
		public String Memo
        {
            get;
            set;
        }
		
		/// <summary>
		/// InUserID : 
		/// </summary>
        [DisplayName("输入人ID")]
        [Required(ErrorMessage = "不允许为空!")]
        
		[DataMember]
		public Int32 InUserID
        {
            get;
            set;
        }
		
		/// <summary>
		/// InDate :输入日期 
		/// </summary>
        [DisplayName("输入日期")]
        
		[DataMember]
		public DateTime InDate
        {
            get;
            set;
        }
		
		/// <summary>
		/// EditUserID : 编辑人ID
		/// </summary>
        [DisplayName("编辑人ID")]
        [Required(ErrorMessage = "不允许为空!")]
        
		[DataMember]
		public Int32 EditUserID
        {
            get;
            set;
        }
		
		/// <summary>
		/// EditDate : 编辑日期
		/// </summary>
        [DisplayName("编辑日期")]
        [Required(ErrorMessage = "不允许为空!")]
        
		[DataMember]
		public DateTime EditDate
        {
            get;
            set;
        }
		
		/// <summary>
		/// Avatar : 头像
		/// </summary>
        [DisplayName("头像")]
        [StringLength(128, ErrorMessage = "请勿输入超过 128 个字!")]
        
		[DataMember]
		public String Avatar
        {
            get;
            set;
        }
		
		/// <summary>
        /// Certificate1 : 证书1
		/// </summary>
        [DisplayName("证书1")]
        [StringLength(128, ErrorMessage = "请勿输入超过 128 个字!")]
        
		[DataMember]
		public String Certificate1
        {
            get;
            set;
        }
		
		/// <summary>
		/// Certificate2 : 证书2
		/// </summary>
        [DisplayName("证书2")]
        [StringLength(128, ErrorMessage = "请勿输入超过 128 个字!")]
        
		[DataMember]
		public String Certificate2
        {
            get;
            set;
        }
		
		/// <summary>
		/// BBSCustomerID : 论坛ID
		/// </summary>
        [DisplayName("论坛ID")]
        
		[DataMember]
		public Int32? BBSCustomerID
        {
            get;
            set;
        }
		#endregion

		#endregion 属性、变量声明
        public MemberInfoEntity(IDataReader dataReader)
            : base(dataReader)
        {
            CustomerID = Convert.IsDBNull(dataReader["CustomerID"]) ? 0 : Convert.ToInt32(dataReader["CustomerID"]);
            LoginName = Convert.IsDBNull(dataReader["CustomerID"]) ? "" : Convert.ToString(dataReader["LoginName"]);
            RealName = Convert.IsDBNull(dataReader["RealName"]) ? "" : Convert.ToString(dataReader["RealName"]);
            CustomerName = Convert.IsDBNull(dataReader["CustomerName"]) ? "" : Convert.ToString(dataReader["CustomerName"]);
            Gender = Convert.IsDBNull(dataReader["Gender"]) ? 0 : Convert.ToInt32(dataReader["Gender"]);
            Age = Convert.IsDBNull(dataReader["Age"]) ? 0 : Convert.ToInt32(dataReader["Age"]);
            DateOfBirth = Convert.IsDBNull(dataReader["DateOfBirth"]) ? DateTime.Now : Convert.ToDateTime(dataReader["DateOfBirth"]);
            IdentityCard = Convert.IsDBNull(dataReader["IdentityCard"]) ? "" : Convert.ToString(dataReader["IdentityCard"]);
            RegionCode = Convert.IsDBNull(dataReader["RegionCode"]) ? "" : Convert.ToString(dataReader["RegionCode"]);
            Adress = Convert.IsDBNull(dataReader["Adress"]) ? "" : Convert.ToString(dataReader["Adress"]);
            Organization = Convert.IsDBNull(dataReader["Organization"]) ? "" : Convert.ToString(dataReader["Organization"]);
            Identity = Convert.IsDBNull(dataReader["Identity"]) ? 0 : Convert.ToInt32(dataReader["Identity"]); 
            Grade = Convert.IsDBNull(dataReader["Grade"]) ? 0 : Convert.ToInt32(dataReader["Grade"]); 
            CellPhone = Convert.IsDBNull(dataReader["CellPhone"]) ? "" : Convert.ToString(dataReader["CellPhone"]);
            Phone = Convert.IsDBNull(dataReader["Phone"]) ? "" : Convert.ToString(dataReader["Phone"]);
            QQ = Convert.IsDBNull(dataReader["QQ"]) ? "" : Convert.ToString(dataReader["QQ"]);
            EMail = Convert.IsDBNull(dataReader["EMail"]) ? "" : Convert.ToString(dataReader["EMail"]);
            MSN = Convert.IsDBNull(dataReader["MSN"]) ? "" : Convert.ToString(dataReader["MSN"]);
            Memo = Convert.IsDBNull(dataReader["Memo"]) ? "" : Convert.ToString(dataReader["Memo"]);
            InUserID = Convert.IsDBNull(dataReader["InUserID"]) ? 0 : Convert.ToInt32(dataReader["InUserID"]);
            InDate = Convert.IsDBNull(dataReader["InDate"]) ? DateTime.MinValue : Convert.ToDateTime(dataReader["InDate"]);
            EditUserID = Convert.IsDBNull(dataReader["EditUserID"]) ? 0 : Convert.ToInt32(dataReader["EditUserID"]);
            EditDate = DateTime.Now;
            Avatar = Convert.IsDBNull(dataReader["Avatar"]) ? "" : Convert.ToString(dataReader["Avatar"]);
            Certificate1 = Convert.IsDBNull(dataReader["Certificate1"]) ? "" : Convert.ToString(dataReader["Certificate1"]);
            Certificate2 = Convert.IsDBNull(dataReader["Certificate2"]) ? "" : Convert.ToString(dataReader["Certificate2"]); 
            BBSCustomerID = Convert.IsDBNull(dataReader["BBSCustomerID"]) ? 0 : Convert.ToInt32(dataReader["BBSCustomerID"]);
        }
	    public MemberInfoEntity()
        {
            CustomerID = (int)0;
            LoginName = string.Empty;
            RealName = null;
            CustomerName = string.Empty;
            Gender = null;
            Age = null;
            DateOfBirth = DateTime.MinValue;
            IdentityCard = null;
            RegionCode = null;
            Adress = null;
            Organization = null;
            Identity = (int)0;
            Grade = (int)0;
            CellPhone = null;
            Phone = null;
            QQ = null;
            EMail = null;
            MSN = null;
            Memo = null;
            InUserID = (int)0;
            InDate = DateTime.Now;
            EditUserID = (int)0;
            EditDate = DateTime.Now;
            Avatar = null;
            Certificate1 = null;
            Certificate2 = null;
            BBSCustomerID = null;
        }
	}
}
